<h1><?=$this->title?></h1>

<? if ($this->error): ?>
    <p style="color: #F00; margin: 5px;"><?=$this->error?></p>
<? endif ?>

<form action="/<?=$this->page?>/add" method="post" onsubmit="return add();">
    <div class="default">
    <label for="name">Име:</label>
    <input type="text" name="name" id="name" />
    <input type="submit" value="Добавяне" class="button" />
    </div>
</form>

<? if (count($this->items)): ?>

<table class="simple">
    <thead>
        <tr>
            <th>ID</th>
            <th>Име</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <? foreach ($this->items as $item): ?>
        <tr>
            <td class="ids"><?=$item->id?></td>
            <td id="n_<?=$item->id?>"><?=$this->escape($item->name)?></td>
            <td class="action">
                <img class="action" alt="edit" title="Редакция" src="<?=$this->staticUrl()?>/img/edit.gif" onclick="edit('<?=$item->id?>')" />
                <a href="/<?=$this->page?>/remove/id/<?=$item->id?>" onclick="return window.confirm('Сигурни ли сте?');">
                    <img class="action" alt="remove" title="Изтриване" src="<?=$this->staticUrl()?>/img/remove.gif" />
                </a>
            </td>
        </tr>
    <? endforeach ?>
    </tbody>
</table>

<? else: ?>

Няма резултати

<? endif ?>

<script type="text/javascript">
var staticUrl = '<?=$this->staticUrl()?>';
var page = '<?=$this->page?>';
</script>

<script type="text/javascript" src="<?=$this->staticUrl()?>/js/simple.js"></script>
